<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCoachesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $table_name = 'coaches';
        Schema::create($table_name, function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('tenant_id')->index()->comment('租户ID');
            $table->integer('user_id')->index()->default(0)->comment('用户ID');
            $table->string('realname', 50)->default('')->comment('真实姓名');
            $table->string('phone', 20)->default('')->comment('手机号码');
            $table->tinyInteger('gender')->default(1)->comment('性别:1=男,2=女');
            $table->string('cover_url')->default('')->comment('封面图');
            $table->decimal('price')->comment('价格,xx元/节');
            $table->integer('sale_num')->default(1)->comment('起售节数');
            $table->string('brief_intro')->default('')->comment('简介');
            $table->string('expert')->default('')->comment('擅长项目');
            $table->boolean('is_enable')->default(true)->comment('是否启用');
            $table->string('qualification')->default('')->comment('专业资质');
            $table->timestamps();
        });
        add_table_comment($table_name, '教练表');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('coaches');
    }
}
